package threading;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: xwl
 * Date: 2023-08-08
 * Time: 10:12
 */
public class ThreadDemo7 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread( () -> {
            System.out.println("hello t");
        });
        t.start();

        // main线程中调用t.join -> 让main线程等待t线程先结束
        t.join();
        System.out.println("hello main");
    }
}
